@inject('categories','App\Models\Category')
@php
    $categories = $categories->where('pid',0)->get()
@endphp
<div class="g_header clearfix">
    <div class=" g_cw ">
        <div class="main flex items-center">
            <a href="{{route('home')}}" class="logo">
                <img src="{{$config['logo']}}">
            </a>
            <ul class="nav flex items-center p-0">
                <li>
                    <a href="{{route('home')}}" class="{{ active_class(if_route('home')) }}">
                        <b>网站首页</b>
                        <em>HOME</em>
                    </a>
                </li>
                @foreach($categories->all() as $category)
                    <li>
                        <a href="{{ route('category',[$category]) }}"
                           class="{{ active_class(\Request::url()==route('category',[$category])) }}">
                            <b>{{$category->title}}</b>
                            <em>{{$category->name}}</em>
                        </a>
                    </li>
                @endforeach
                <li><a href="{{route('order.index')}}" class="{{ active_class(if_route('order.index')) }}"> <b>服务预约</b>
                        <em>ORDER</em>
                    </a>
                </li>
                <li><a href="{{route('about')}}" class="{{ active_class(if_route('about')) }}"> <b>联系我们</b>
                        <em>CONTRACT</em>
                    </a>
                </li>
            </ul>
        </div>

    </div>
</div>
